package com.twu.book;

import com.twu.biblioteca.BibliotecaShow;

import java.io.PrintStream;

/**
 * Created with IntelliJ IDEA.
 * User: root
 * Date: 6/28/13
 * Time: 2:13 AM
 * To change this template use File | Settings | File Templates.
 */
public class Book {

    private String number;
    private String title;
    private String author;

    private boolean available = true;

    public Book(String number, String title, String author) {
        setAuthor(author);
        setNumber(number);
        setTitle(title);
    }


    public String getNumber() {
        return number;
    }

    public String getTitle() {
        return title;
    }

    public String getAuthor() {
        return author;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public void reserve(PrintStream output)
    {
        if(available)
        {
            BibliotecaShow.showReserveSuccess(output);
            available = false;
        }
        else
        {
            BibliotecaShow.showReserveFail(output);
        }
    }
}
